#pragma once
#include "threadbase.h"

namespace cupid
{
class WorldKernel;
class IMessagePort;

class WorldThread :
	public cupid::ThreadBase
{
public:
	WorldThread(IMessagePort* port);
	virtual ~WorldThread();

public: // overload
	virtual bool createThread(bool run = true);	

	/////////////////////////////////////////////////////////////////////
protected:

	virtual	void	onInit();
	virtual bool	onProcess();	
	virtual void	onDestroy();

protected: 
	clock_t			m_nextClock;
	CC_SYNTHESIZE(WorldKernel*, m_world, World);
	CC_SYNTHESIZE(IMessagePort*, m_msgPort, MsgPort);
	HANDLE			m_mutexThread;
};
}